Optics can be thought of as performing mathematical operations transforming light intensities from different incident angles to locations on a two-dimensional image sensor. In the case of focusing optics, this transformation is the identity function: each angle is mapped to a distinct corresponding point on the sensor. When focusing optics are impractical due to size, cost, or material constraints, the right diffractive optic can perform an operation other than the identity function that is nonetheless useful to produce a final image. In such cases the sensed data may bear little or no resemblance to the captured scene; however, a desired digital image can be computed from the sensor outputs.